package train.time0621;

public class No3 {
	
	public static void main(String[] args) {
		double[] numArr = {-1,1,2,3,-1,-2};
		double count = 0;
		double max = 0;
		String tempS = "";
		String endS = "";
		for (int start = 0; start < numArr.length; start++) {
			for (int end = start; end < numArr.length; end++) {
				for (int i = start; i <= end; i++) {
					count=count+numArr[i];
					tempS=tempS+numArr[i]+",";
				}
				if(count>max){
					endS=tempS;
					max=count;
				}
				count = 0;
				tempS = "";
			}
		}
		System.out.println(endS);
		System.out.println(max);
	}

}
